import com.wyl.pojo.Person
import org.junit.Test
import org.springframework.beans.factory.getBean
import org.springframework.context.support.ClassPathXmlApplicationContext

class AutowiredTest {
    @Test
    fun test() {
        val context = ClassPathXmlApplicationContext("beans2.xml")
        val person = context.getBean<Person>("person")
        person.cat.shout()
        person.dog.shout()
    }
}